#include "DSInterface.h"

class NativeIntStack abstract {
protected :
	DSHandle* m_phDS;
public :
	NativeIntStack() {
		m_phDS = new DSHandle;
	}
	~NativeIntStack() {
		delete m_phDS;
	}

	void push(int a_nData) {
		pushIntStack(m_phDS, a_nData);
	}
	int pop() {
		return popIntStack(m_phDS);
	}
	bool canPush() {
		return canPushIntStack(m_phDS);
	}
	bool canPop() {
		return canPopIntStack(m_phDS);
	}
	int getDataCount() {
		return getDataCountIntStack(m_phDS);
	}
};

class NativeIntArrayStack : public NativeIntStack {
public :
	NativeIntArrayStack(int a_nSize, bool a_bConcurrent) {
		setDefaultIntegerArrayStackHandle(m_phDS, a_nSize, a_bConcurrent);
		createDS(m_phDS);
	}
	~NativeIntArrayStack() {
		destroyDS(m_phDS);
	}
};

class NativeIntLinkedStack : public NativeIntStack {
public :
	NativeIntLinkedStack(int a_nMaxSize, bool a_bConcurrent) {
		setDefaultIntegerLinkedStackHandle(m_phDS, a_nMaxSize, a_bConcurrent);
		createDS(m_phDS);
	}
	~NativeIntLinkedStack() {
		destroyDS(m_phDS);
	}
};

class NativeIntQueue {
protected :
	DSHandle* m_phDS;
public :
	NativeIntQueue() {
		m_phDS = new DSHandle;
	}
	~NativeIntQueue() {
		delete m_phDS;
	}

	void offer(int a_nData) {
		offerIntQueue(m_phDS, a_nData);
	}
	int poll() {
		return pollIntQueue(m_phDS);
	}
	int peek() {
		return peekIntQueue(m_phDS);
	}
	bool canOffer() {
		return canOfferIntQueue(m_phDS);
	}
	bool canPoll() {
		return canPollIntQueue(m_phDS);
	}
	int getQueueDataCount() {
		return getDataCountIntQueue(m_phDS);
	}
};

class NativeIntArrayQueue : public NativeIntQueue {
public :
	NativeIntArrayQueue(int a_nSize, bool a_bConcurrent) {
		setDefaultIntegerArrayQueueHandle(m_phDS, a_nSize, a_bConcurrent);
		createDS(m_phDS);
	}
	~NativeIntArrayQueue() {
		destroyDS(m_phDS);
	}
};

class NativeIntLinkedQueue : public NativeIntQueue {
public :
	NativeIntLinkedQueue(int a_nMaxSize, bool a_bConcurrent) {
		setDefaultIntegerLinkedQueueHandle(m_phDS, a_nMaxSize, a_bConcurrent);
		createDS(m_phDS);
	}
	~NativeIntLinkedQueue() {
		destroyDS(m_phDS);
	}
};